import request from '@/utils/request';
import {HOST_URL} from '../utils/utils'

export async function query() {
  return request(`${HOST_URL}/api/users`);
}

export async function queryCurrent() {
  return request(`/login_info`, {
    method: 'GET',
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded;'
    }
  });
}
export async function login(payload) {
  return request(`/login`, {
    method: 'POST',
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded;'
    },
    body: `username=${payload.username}&password=${payload.password}`
  });
}
